
	<h1>voiD powered describer</h1>
	<p>When you submit a uri, it will be matched against datasets with a void:uriRegexPattern property. Matching datasets will have their void:sparqlEndpoints queried for a description of that URI</p>
<form action="" method="get" accept-charset="utf-8">
	
	<label for="uri">URI</label><input type="text" name="uri" value="<?php if (isset($_GET['uri'])) echo $_GET['uri'] ?>" id="uri" class="uri"/>
	
	<p><input type="submit" value="Search"/></p>
</form>
<?php if (isset($examples)): ?>
	eg:
	<?php var_dump($examples) ?>
	<ul>
	<?php foreach ($examples as $row): ?>
	<li>
		<a href="?uri=<?php echo urlencode($row['example']['value']) ?>"><?php echo($row['example']['value']) ?></a>
	</li>	
	<?php endforeach ?>
	</ul>
<?php endif ?>


<?php if (isset($error)) echo $error ?>
<?php else if(isset($graph)):?>	
	<h3>From Datasets:</h3>
	<p>
		<?php echo $count ?> matching datasets
	</p>
	<ul>
		<?php foreach ($void->get_subjects_of_type($VOID.'Dataset') as $uri): ?>
			<li>
				
				<?php echo renderBrowseLink($uri, $void) ?>
			</li>
		<?php endforeach ?>
	</ul>
	<div class="resources">
	<div  class="-rdf-Resource">
		<h2>
			<?php echo $graph->get_label($_GET['uri']) ?>
		</h2>
		<dl>
		<?php 
		$index = $graph->get_index();
		if(isset($index[$_GET['uri']])){
		foreach ($index[$_GET['uri']] as $property => $objects): ?>
			<dt>
				<?php echo $graph->get_label($property) ?>
			</dt>
			<?php foreach ($objects as $o): ?>
				<dd><?php renderObject($o, $property, $graph) ?></dd>
			<?php endforeach ?>
		<?php endforeach ?>
		<?php } else {
			?>
			<p>
				Sorry, no triples about that URI were found by SPARQLing those Datasets
				<?php foreach ($queries as $query): ?>
					<p><a href="<?php echo $query ?>"><?php echo $graph->get_label($query) ?></a></p>
				<?php endforeach ?>
			</p>
	<?php	} ?>
		</dl>
	</div>
	</div>
<?php endif ?>

